/*
 * @Author: yangzr 1076420747@qq.com
 * @Date: 2022-12-21 09:22:03
 * @LastEditors: yangzr 1076420747@qq.com
 * @LastEditTime: 2023-02-27 20:52:40
 * @FilePath: \ktgj-crm\src\common\Api\request_interface.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import axios from '../../config/axios'
import {
  baseURL
} from "./env";
function jsonToString(obj) {
  let arr = [];
  for (let key in obj) {
    arr.push(key + "=" + obj[key]);
  }
  return arr.join('&');
}
export default {
  // GET permission参数为是否验证登录
  get(path, data) {
    let url = baseURL + path + '?' + jsonToString(data);
    return axios({
      url,
      data,
      method: 'GET'
    })
  },
  // POST
  post(path, data) {
    let url = baseURL + path;
    return axios({
      url,
      data,
      method: 'POST',
      timeout: 200 * 1000,
    })
  }

}